<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no" />
    <meta name="theme-color" content="#000000" />
    <title>Soico</title>
    <link rel="stylesheet" href="../../css/main.827f7436.css" />
    <link rel="stylesheet" href="../../css/materialize.min.css" />
    <link rel="stylesheet" href="../../css/App.css" />
    <link rel="stylesheet" href="../../css/Header.css">
    <script type="text/javascript" async="" src="../../js/common/recaptcha__zh_cn.js"></script>
    <script type="text/javascript" src="../../js/common/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="../../js/common/materialize.min.js"></script>
    <script type="text/javascript" src="../../js/common/main.312bc4ae.js"></script>
    <script type="text/javascript" src="../../js/common/public.js"></script>
    <script type="text/javascript" src="../../js/common/layer.js"></script>
    <script type="text/javascript" src="../../js/common/requestAPi.js"></script>

</head>
<body>
<div id="root">
    <div style="background-color: rgb(250, 250, 250); min-height: 100vh; min-width: 1000px; font-family:Helvetica Neue, Helvetica, Arial, sans-serif;">
        <div>
            <div class="s-alert-wrapper"></div>
            <%@include file="top.jsp"%>
            <div class="container">
                <div style="padding-top: 20px; padding-bottom: 20px; width: 70%; margin: auto; display: block;">
                    <div class="cardContainer">
                        <p class="cardTitle">发布项目 / Submit a project</p>
                        <div style="height: 1px; background-color: rgb(186, 184, 184); margin: 10px 0px;"></div>
                        <div>
                            <div class="row pageContainer">
                                <p style="font-size: 0.9em; margin-left: 40px; margin-right: 40px; text-align: center;">发布项目到SOICO.CO以获得最多全球中文投资者的关注！ 请填写以下资料，我们会在24小时内与您联系。若您有特別的問題請您寄件至 project@soico.co</p>
                                <p style="font-size: 0.9em; margin-left: 40px; margin-right: 40px; text-align: center;">Submit your project on SOICO.CO to help you reach the biggest mandarin speaking investor community. Please complete the form below and we will contact you in 24 hours. If you have any question please email to: project@soico.co</p>
                                <form id="project" class="col s10 offset-s1 card">
                                    <div class="row">
                                        <div class="input-field col s12">
                                            <div>
                                                <label class="active"></label>
                                                <div class="e_mail">
                                                    <input type="email" class="email" name="e_mail" value="" />
                                                    <label class="" for="email">Email</label>
                                                    <span class="red-text hide">请输入正确的邮箱</span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="input-field col s12">
                                            <div>
                                                <label class="active"></label>
                                                <div class="displayName">
                                                    <input type="text" name="name" class="displayName" value="" />
                                                    <label class="" for="displayName">您的姓名</label>
                                                    <span class="red-text hide">请输入正确的姓名</span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="input-field col s12">
                                            <div>
                                                <label class="active"></label>
                                                <div class="project_name">
                                                    <input type="text" name="project_name" class="projectName" value="" />
                                                    <label class="" for="projectName">项目名称</label>
                                                    <span class="red-text hide">请输入正确的项目名称</span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="input-field col s12">
                                            <div>
                                                <label class="active"></label>
                                                <div class="web_site">
                                                    <input type="text" name="web_site" class="projectSite" value="" />
                                                    <label class="" for="projectSite">造访网站</label>
                                                    <span class="red-text hide">请输入正确的网站</span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row">
                                        <div class="input-field col s12">
                                            <div>
                                                <label class="active"></label>
                                                <div class="project_info">
                                                    <textarea name="project_info" class="projectDescription" style="margin-top: 8px; padding-left: 8px; border: 1px solid rgb(0, 93, 170); height: 69px;" id="projectDescription"></textarea>
                                                    <label class="" for="projectDescription">项目简介(1000字以内)</label>
                                                    <span class="red-text hide">请输入项目简介</span>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="col s5 offset-s7" style="margin-bottom: 20px;">
                                        <a class="btn waves-effect waves-light signupBtn col s12 slotting" href="javascript:;">发送</a>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <footer class="page-footer">
                <%@include file="footer.jsp"%>
            </footer>
        </div>
    </div>
</div>
</body>
<script type="text/javascript">
    $(function(){

        $("#project input,#project textarea").on("blur",function(){
            var obj = $(this);
            var vals = $(this).val();
            if(vals==''){
                obj.siblings("label").removeClass("active")
            }
            checkForm(obj);
        });
        $("#project input,#project textarea").on("focus",function(){
            var obj = $(this);
            obj.siblings("label").addClass("active")
        });

        function checkForm(obj){ // #tbInfoBox

            if($(obj).hasClass("email")){
                var email=(obj).val().trim();
                if(!isEmail(email)){
                    $(obj).siblings(".red-text").removeClass("hide");
                    return false;
                }else{
                    $(obj).siblings(".red-text").addClass("hide");
                }
            }

            if($(obj).hasClass("displayName")){
                var name=(obj).val().trim();
                if(!isUserName(name)){
                    $(obj).siblings(".red-text").removeClass("hide");
                    return false;
                }else{
                    $(obj).siblings(".red-text").addClass("hide");
                }
            }

            if($(obj).hasClass("projectName")){
                var projectName=(obj).val();
                if(projectName==''){
                    $(obj).siblings(".red-text").removeClass("hide");
                    return false;
                }else{
                    $(obj).siblings(".red-text").addClass("hide");
                }
            }

            if($(obj).hasClass("projectSite")){
                var projectSite=(obj).val();
                if(projectSite==''){
                    $(obj).siblings(".red-text").removeClass("hide");
                    return false;
                }else{
                    $(obj).siblings(".red-text").addClass("hide");
                }
            }

            if($(obj).hasClass("projectDescription")){
                var projectDescription=(obj).val();
                if(projectDescription==''){
                    $(obj).siblings(".red-text").removeClass("hide");
                    return false;
                }else{
                    $(obj).siblings(".red-text").addClass("hide");
                }
            }



            return true;
        }

        $("#submit").click(function(){
            debugger
            var objArray = $("#project input,#project textarea");
            var objArrayLen = objArray.length;
            for(var i = 0; i < objArrayLen; i++){
                flagForm = checkForm($(objArray[i]));
                if(!flagForm){
                    return false;
                }
            }
            var email = $("input[name='email']").val();
            var displayName = $("input[name='displayName']").val();
            var projectName = $("input[name='projectName']").val();
            var projectSite = $("input[name='projectSite']").val();
            var projectDescription = $('#projectDescription').val();
            var data = {
                e_mail:email,
                name:displayName,
                project_name:projectName,
                web_site:projectSite,
                project_info:projectDescription
            }

        })
    })


</script>
</html>